#include <REGX52.H>

#include <INTRINS.H>


void Delay500ms(void)	//@12.000MHz
{
	unsigned char data i, j, k;

	_nop_();
	i = 4;
	j = 205;
	k = 187;
	do
	{
		do
		{
			while (--k);
		} while (--j);
	} while (--i);
}


/*void main()
{
	while(1)
	{
		P2 = 0xFE ;// 1111 1110
		Delay500ms();
		P2 = 0xFD; // 1111 1101
		Delay500ms();
		P2 = 0xFB; // 1111 1011
		Delay500ms();
		P2 = 0xF7; // 1111 0111
		Delay500ms();
		P2 = 0xEF; // 1110 1111
		Delay500ms();
		P2 = 0xDF; // 1101 1111
		Delay500ms();
		P2 = 0xBF; // 1011 1111
		Delay500ms();
		P2 = 0x7F; // 0111 1111
		Delay500ms();
	}
}*/

void main()
{
	int a = 0x01;
	int b = 0xFF;
	int i = 0;
	while(1)
	{
		for(i = 0;i < 8;i++)
		{
			P2 = b ^ a;
			a = a * 2;
			Delay500ms();
		}
		a = 0x01;
	}
}

